package com.conan.spring5.service.impl;

import com.conan.spring5.dao.UserDAO;
import com.conan.spring5.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @version 加油！！！
 * @Description
 * @Author 谷藤新一GYC
 * @Date 2022/10/21 - 15:02
 */
//在注解里面value属性值可以省略不写,
//默认值是类名称首字母小写:UserService --- userService
@Service
public class UserServiceImpl implements UserService {
    //定义dao属性类型
    //不需要添加set方法
    //添加注入属性注解
    @Autowired  //根据类型进行注入
    @Qualifier(value = "userDAOImpl1")
    private UserDAO userDAO;

    @Override
    public void add() {
        System.out.println("service add......");
        userDAO.add();
    }

}
   